package com.wenhao.meituan.interview;

import javax.swing.plaf.nimbus.NimbusLookAndFeel;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;
import java.util.Set;

/**
 * @author Wenhao Tong
 * @create 2021-08-08 10:50
 */
public class Main4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] preHalf = new int[n / 2];
        int[] lastHalf = new int[n / 2];
        for (int i = 0;i < n / 2;i++) {
            preHalf[i] = scanner.nextInt();
        }
        for (int i = 0;i < n / 2;i++) {
            lastHalf[i] = scanner.nextInt();
        }
        Set<Integer> set1 = new HashSet<>();
        Set<Integer> set2 = new HashSet<>();
        for (int i = 0;i < n / 2;i++) {
            if (lastHalf[i] != preHalf[i]) {
                set2.add(lastHalf[i]);
                set1.add(preHalf[i]);
            }
        }
        int count = 0;
        Iterator<Integer> iterator = set1.iterator();
        while (iterator.hasNext()) {
            if (set2.contains(iterator.next())) {
                count++;
            }
        }
        int result = (count + 1) / 2 + set1.size() > set2.size() ? set1.size() : set2.size() - count;
        System.out.println(result);
    }
}
